class Jump{
constructor(){
    this.ul = document.querySelector('.page-list')
    this.getclick()
}
getclick(){
    $.get('../data/list.json').then((res) => {
        var data = res
        this.ul.onclick = (e) => {
            var e = e || window.event
            var target = e.target || e.srcElement
            if (target.nodeName == 'IMG') {
                let targetId = target.dataset.id
                let goods = data.find((item) => {
                    return item.id == targetId
                })
                localStorage.setItem('cart1',JSON.stringify(goods))
            }
        }
    })
}
}
new Jump()





